package medium;
/*
153. 寻找旋转排序数组中的最小值
解题思路：二分查找算法
 */
public class LeeCode153 {

  public static void main(String[] args) {

  }

  public int findMin(int[] nums) {
    int left = 0;
    int right = nums.length - 1;
    while (left < right){
      int pivot = left + (right - left)/2;
      if (nums[pivot] < nums[right]){
        right = pivot;
      }else {
        left = pivot + 1;
      }
    }
    return nums[left];
  }
}
